<html xmlns:th="http://www.thymeleaf.org">
    <th:block th:fragment="category_tree">
    

<div id="category_tree">
<div class="tit">所有商品分类</div>
<dl class="clearfix" style=" overflow:hidden;" >
<div class="box1 cate" id="cate"> 
  <!--{foreach from=$categories item=cat name=no}--> 
  <h1 onclick="tab()"  <!-- {if $smarty.foreach.no.first} --> style="border-top:none" <!-- {/if} -->  > 
  <span class="f_l"><img src="/static/images/btn_fold.gif" style="padding-top:10px;padding-right:6px;cursor:pointer;"></span>
  </h1>
  <a  <!-- {if $smarty.foreach.no.first} --> style="border-top:none" <!-- {/if} --> th:href="${cat.url}" class="  f_ll" ></a>
  <ul style="display:none" >
    <!--{foreach from=$cat.cat_id item=child}--> 
    <a class="over_2" th:href="${child.url}"></a>
    <div class="clearfix"> 
      <!--{foreach from=$child.cat_id item=childer}--> 
      <a class="over_3" th:href="${childer.url}"></a> 
      <!--{/foreach}--> 
    </div>
    <!--{/foreach}-->
  </ul>
  <div style="clear:both"></div>
  <!--{/foreach}--> 
</div>
<div style="clear:both"></div>
</div>
<div class="blank"></div>
<script type="text/javascript">
obj_h4 = document.getElementById("cate").getElementsByTagName("h4")
obj_ul = document.getElementById("cate").getElementsByTagName("ul")
obj_img = document.getElementById("cate").getElementsByTagName("img")
function tab(id)
{ 
		if(obj_ul.item(id).style.display == "block")
		{
			obj_ul.item(id).style.display = "none"
			obj_img.item(id).src = "images/btn_fold.gif"
			return false;
		}
		else(obj_ul.item(id).style.display == "none")
		{
			obj_ul.item(id).style.display = "block"
			obj_img.item(id).src = "images/btn_unfold.gif"
		}
}
</script>
    </th:block>
</html>